home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
SHARED.DIR
/
03091_Script_COPY SCREEN
< prev
next >
Wrap
Text File
|
1996-04-01
|
7KB
|
203 lines
-- --------------------------------------------------------------------------------------
-- Handler setUpCopyXobj opens the xobject that will be used for copying throughout the
-- program. It is opened once at the beginning of the programe and closed once at the end
-- because if the object is disposed of, pasting into other applications does not work.
on setUpCopyXobj
global copyObj
if (the machineType = 256) then
openXObjHandler "STAGETC.DLL"
-- create a new object
set copyObj = stageTC(mNew, 0, 0, the stageBottom - the stageTop, the stageRight-the stageLeft)
else
openXObjHandler "StageToCast XObj"
-- create a new object
set copyObj = stageToCast(mNew, 0, 0, the stageBottom - the stageTop, the stageRight-the stageLeft)
end if
end
--mNew -- creates the object in RAM,
-- and is used to specify the region
-- of the screen. Four integers are in
-- order of: Top, Left, Bottom, Right.
-- Example of Lingo syntax:
-- --------------------------------------------------------------------------------------
-- Handler endCopyXobj disposes of the instance of the xobject and closes the xobject
-- that will be used for copying throughout the program. It is opened once at the
-- beginning of the programe and closed once at the end because if the object is
-- disposed of, pasting into other applications does not work.
on endCopyXobj
global copyObj
if objectP(copyObj) then
copyObj(mdispose)
end if
if (the machineType = 256) then
closeXObjHandler "STAGETC.DLL"
else
closeXObjHandler "StageToCast XObj"
end if
end
-- --------------------------------------------------------------------------------------
-- Handler doClickCopyButton hilites the copy button and copies the screen.
on doClickCopyButton copyType, source
puppetTransition 0
sound stop 1
hiliteButton(1,0)
doCopy(copyType, source)
allowPastingMAC
dontPassEvent
end
-- --------------------------------------------------------------------------------------
-- Handler doCopy calls the appropriate copy handler to copy
-- the current screen
on doCopy copyType, source
if (copyType = "dataBase") then
copyDatabase
else if (copyType = "timeLine") then
copyTimeline
else if (copyType = "cast") then
copyCast(source)
else if (copyType = "file") then
copyFile(source)
end if
end
-- --------------------------------------------------------------------------------------
-- Handler copyTimeline ???
on copyTimeline
copyToClipBoard cast "TimeLineTextForCopying"
end
-- --------------------------------------------------------------------------------------
-- Handler copyDatabase copies the picture or text of the currently selected database
-- topic.
on copyDatabase
global copyObj, textButton, pictureButton
-- call the copy function to copy
if isActivated(textButton) then
copyDatabaseText
else if isActivated(pictureButton) then
copyDatabasePicture
end if
end
-- ----------------------------------------------------------------
-- Handler copyDataBaseText does the actual copying of the text
-- of the selected topic in the database to the clipboard.
on copyDatabaseText
global textSprite, numPagesInClickedTopic, clickedTopic, copyTextCast
put EMPTY into cast copyTextCast
if (the editableText of sprite textSprite = TRUE) then
set copyText = the selection
set the editableText of sprite textSprite = FALSE
put copyText into cast copyTextCast
else
put clickedTopic & RETURN into field copyTextCast -- Article Title
repeat with curPage = 1 to numPagesInClickedTopic
put the text of cast (clickedTopic && "TEXT" & curPage) & RETURN after cast copyTextCast
end repeat
put RETURN & "⌐1996 SoftKey Multimedia Inc., a subsidiary of SoftKey International Inc." after cast copyTextCast
end if
copyToClipBoard cast copyTextCast
end
-- ----------------------------------------------------------------
-- Handler copyDataBasePicture does the actual copying of the
-- picture of the selected topic in the database to the clipboard.
on copyDatabasePicture
global pictureSprite, clickedTopic
copyToClipBoard cast the castNum of sprite pictureSprite
end
-- --------------------------------------------------------------------------------------
-- Handler copyCast copies the given cast to the clipBoard
on copyCast whichCast
copyToClipBoard cast whichCast
end
-- --------------------------------------------------------------------------------------
-- Handler copyFile imports the given file to a cast and then copies the cast
-- to the clipBoard
on copyFile whichFile
global copyPictureCast
if (the machineType = 256) then
set divider = "\"
else
set divider = ":"
end if
set fullFileName = the pathName & "PrtPicts" & divider & whichFile
importFileInto cast copyPictureCast, fullFileName
copyToClipBoard cast copyPictureCast
end
-- --------------------------------------------------------------------------------------
-- Handler allowPastingMAC allows the user to paste what was copied by going to the finder
-- after a copy was done.
on allowPastingMAC
if (the machineType = 256) then exit
global dialogSprite, pasteNowRect, cancelPasteRect
global pasteDialogLocH, pasteDialogLocV
set the castNum of sprite dialogSprite = the number of cast "copy Dialog"
set the locH of sprite dialogSprite = pasteDialogLocH
set the locV of sprite dialogSprite = pasteDialogLocV
updateStage
choosePasteOption
end
-- --------------------------------------------------------------------------------------
-- Handler choosePasteOption is the cast script of the copy dialog box. it allows the
-- user to choose a paste option and works well with the interruptanimation handler
on choosePasteOption
repeat while not (the mousedown)
updatestage
end repeat
global dialogSprite, pasteNowRect, cancelPasteRect
-- find out where clicked
set clickPoint = point(the mouseH, the mouseV)
if (inside(clickPoint, pasteNowRect)) then
-- don't use removeFromStage because this updates
-- stage which causes the calling of the script of the
-- sprite under the paste dialog box.
set the locV of sprite dialogSprite = 1000
open "finder"
abort
else
-- don't use removeFromStage because this updates
-- stage which causes the calling of the script of the
-- sprite under the paste dialog box.
set the locV of sprite dialogSprite = 1000)
abort
end if
end